package com.itheima.dao;

import com.github.pagehelper.Page;
import com.itheima.pojo.CheckItem;
import com.itheima.pojo.Menu;
import com.itheima.pojo.Permission;
import com.itheima.pojo.Role;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;
import java.util.Set;

public interface RoleDao {
    public Set<Role> findByUserId(int id);
    public List<Role> findAll();
    public void add(Role role);
    public Page<Role> selectByCondition(String queryString);
    public void deleteById(Integer id);
    public void edit(Role role);
    public Role findById(Integer id);
    public List<Integer> findRoleIdsByUserId(Integer id);
    public Role findByRoleId(Integer id);
    public void setRoleAndPermission(@Param("role_id") Integer role_id,@Param("permission_id") Integer permissionId);
    public void setRoleAndMenu(@Param("role_id") Integer id, @Param("menu_id") Integer menuId);
    public List<Integer> findPermissionIdsByRoleId(Integer id);
    public List<Integer> findMenuIdsByRoleId(Integer id);

    public Permission findByPermissionId(Integer id);
    public Menu findByMenuId(Integer id);

    public void deleteByPermissionId(Integer id);
    public void deleteByMenuId(Integer id);
    public void deleteByRoleId(Integer id);

    public List<Integer> findPermissionByRole(Integer id);
}
